/**
  ******************************************************************************
  * @file    stm32l475e_iot01_bus.h
  * @author  MCD Application Team
  * @brief   This file contains definitions for B-L475E-IOT01 bus.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32F4_BUS_H
#define STM32F4_BUS_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#include "stm32f4_error.h"

/** @defgroup STM32F405_BUS_Exported_Constants 
  * @{
  */

#define BUS_I2C1_TIMEOUT                10000U

/**
  * @}
  */

/** @addtogroup STM32F4_BUS_Exported_Variables
  * @{
  */
extern I2C_HandleTypeDef hi2c1;
/**
  * @}
  */

/** @addtogroup STM32F4_BUS_Exported_Functions
  * @{
  */

int32_t BSP_I2C1_WriteReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_ReadReg(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_WriteReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_ReadReg16(uint16_t DevAddr, uint16_t Reg, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_WriteData(uint16_t DevAddr, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_ReadData(uint16_t DevAddr, uint8_t *pData, uint16_t Length);
int32_t BSP_I2C1_IsReady(uint16_t DevAddr, uint32_t Trials);



int32_t BSP_GetTick(void);


#ifdef __cplusplus
}
#endif

#endif /* STM32L475E_IOT01_BUS_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
